<div id="add_company">
	<h1>Lägg till företag</h1>
	<div class="add_company_info">
		<div class="form_errors">
			<?php echo validation_errors(); ?>
		</div>
		<?php if($success) :?>
			Företaget lades till !
		<?php endif; ?>
		<form action="/admin/companies/add_company/<?php if($company): echo $company->id; endif; ?>" class="admin_form" method="post">
			<table cellspacing=0 cellpadding=0>
				<tr>			
					<td>
						<input type="hidden" name="c_id" value="<?php if($company): echo $company->id; endif; ?>"/>
						<input type="text" name="c_name" value="<?php if($company): echo $company->name; endif; ?>" placeholder="Företagsnamn..."/>
						<input type="text" name="c_address" value="<?php if($company): echo $company->address; endif; ?>" placeholder="Adress..."/>
						<input type="text" name="c_orgNumber" value="<?php if($company): echo $company->orgnr; endif; ?>" placeholder="Org-nr..."/>
						<input type="text" name="c_telNumber" value="<?php if($company): echo $company->phone; endif; ?>" placeholder="Tel-nr..."/>
						<input type="text" name="c_email" value="<?php if($company): echo $company->email; endif; ?>" placeholder="Epost..."/>
						<input type="text" name="c_website" value="<?php if($company): echo $company->homepage; endif; ?>" placeholder="Hemsida..."/>
						<input type="text" name="c_tags" value="<?php if($company): echo $company->search_tags; endif; ?>" placeholder="Search tags..."/>
						<select name="c_branch">
							<?php foreach($branchlists as $branchName => $properties): ?>
								<optgroup label="<?php echo $branchName; ?>">
									<?php for($i = 0; $i < count($properties['name']); $i++): ?>
										<option value="<?php echo $properties['id'][$i]; ?>"  <?php if($company): if($properties['id'][$i] == $company->branch): echo "selected"; endif; endif; ?>><?php echo $properties['name'][$i]; ?></option>
									<?php endfor; ?>
								</optgroup>
							<?php endforeach; ?>
						</select>
						<textarea name="c_description" rows="12" cols="45" value="" placeholder="Kort beskrivning..."><?php if($company): echo $company->short_desc; endif;?></textarea>
						<input type="submit" name="c_submit" value="Lägg till"/>
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>